package com.whfc.mach.enums;

/**
 * @author sun_guodong
 * @description 设备保养规则种类
 * @date 2021-03-08
 */
public enum MaintainRuleType {
    FIRST_INTERVAL_HOURS(1, "首次保养", "首次保养:首次工作%s个小时,提醒设备保养"),

    INTERVAL_HOURS(2, "间隔小时", "日常保养:每工作%s个小时,提醒设备保养"),

    INTERVAL_DAYS(3, "间隔天数", "日常保养:每间隔%s天,提醒设备保养");

    private Integer value;

    private String desc;

    private String detail;

    MaintainRuleType(Integer value, String desc, String detail) {
        this.value = value;
        this.desc = desc;
        this.detail = detail;
    }

    public Integer getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public String getDetail() {
        return detail;
    }

    public static MaintainRuleType parseValue(Integer value) {
        switch (value) {
            case 1:
                return FIRST_INTERVAL_HOURS;
            case 2:
                return INTERVAL_HOURS;
            case 3:
                return INTERVAL_DAYS;
            default:
                return null;
        }
    }
}
